package com.example.dllo.my36kr.ui.activity;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import cn.bmob.v3.Bmob;

/**
 * Created by CPC_272 on 16/8/15.
 * activity的基类
 */
public abstract class AbsBaseActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(setLayout());
        Bmob.initialize(this, "ac51df24e2f4feeca5b972599cb7a1a1");
        initView();
        initData();
    }
    protected abstract int setLayout();//放布局
    protected abstract void initView();//放id
    protected abstract void initData();//放方法的
       //跳转的
    protected void goTo(Context from, Class<? extends AbsBaseActivity> to){
        Intent intent = new Intent(from,to);
        startActivity(intent);
    }
     //findViewById的
    protected <T extends View> T byView(int resId){
        return (T)findViewById(resId);
    }
}
